package com.hzncc.flowable_diboot.vo;

import com.diboot.core.binding.annotation.BindEntity;
import com.diboot.core.binding.annotation.BindField;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.entity.FormDesign;
import com.hzncc.flowable_diboot.entity.OppoFlowTemplate;
import com.hzncc.flowable_diboot.entity.OppoFlowTemplateItem;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 商机流程模板项 VO定义
 *
 * @author MyName
 * @version 1.0
 * @date 2024-06-18
 * Copyright © MyCorp
 */
@Getter
@Setter
@Accessors(chain = true)
public class OppoFlowTemplateItemListVO extends OppoFlowTemplateItem {
    private static final long serialVersionUID = 1159031495512723837L;
    /**
     * 模板 关联信息
     */

    @BindField(
            entity = OppoFlowTemplate.class,
            field = "name",
            condition = "this.template_id = id"
    )
    private String templateIdLabel;

    /**
     * 上一节点 关联信息
     */

    @BindField(
            entity = OppoFlowTemplateItem.class,
            field = "code",
            condition = "this.prev = id"
    )
    private String prevLabel;

    /**
     * 创建人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.create_by = id"
    )
    private String createByLabel;

    /**
     * 更新人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.update_by = id"
    )
    private String updateByLabel;

    @BindEntity(entity = FormDesign.class, condition = "this.form_id = id", deepBind = true)
    private FormDesign formDesign;
}